Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rust: doctests: Mark generated rustdoc kunit tests extern "C" #968

Merged
merged 1 commit into from
Feb 16, 2023

Conversation

sulix
Copy link

@sulix sulix commented Feb 16, 2023

The generated rustdoc tests were marked no_mangle, but not extern "C". Since these are called from C by KUnit, they should use the C ABI.

This is a follow up to #967 and #966.

I'm away on a different computer than normal, so it's possible I've missed something: rustfmt passed on the rustdoc_test_gen.rs file itself (since we're just changing the string), but the generated doctests_kernel_generated.rs has lots of formatting issues. I elected not to try to fix those (they probably depend on the length of the test name), and quite a few predate this patch.

The generated rustdoc tests were marked no_mangle, but not extern "C".
Since these are called from C by KUnit, they should use the C ABI.

Signed-off-by: David Gow <davidgow@google.com>
@ojeda
Copy link
Member

ojeda commented Feb 16, 2023

Thanks David!

I elected not to try to fix those (they probably depend on the length of the test name), and quite a few predate this patch.

Yeah, that is fine. We could run rustfmt after they are generated to make them look nicer, like the bindgen ones.

@ojeda ojeda merged commit 1a12514 into Rust-for-Linux:rust Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants